// components/popup/popup.js
Component({
    options: {
        addGlobalClass: true
    },
    /**
     * 组件的属性列表
     */
    properties: {
        title: String,
        cancel: Boolean,
        spaceTapCancel: Boolean,
        submit: Boolean,
        floor: Boolean
    },
    /**
     * 组件的初始数据
     */
    data: {
        bottom: 0
    },

    ready(){
        wx.onKeyboardHeightChange(res=>{
            console.log(res)
            this.setData({
                bottom: res.height / 2
            })
        })
    },

    /**
     * 组件的方法列表
     */
    methods: {
        onFloor(){
            this.triggerEvent('floor')
        },
        onClose() {
            this.triggerEvent('cancel')
        },
        onSubmit() {
            wx.navigateTo({
              url: '/pages/login/login',
            })
            // this.triggerEvent('submit')
        }
    }
})
